Optimal. Leaf size=156 \[ -\frac {2^{n+\frac {1}{2}} \left (n^2+n+1\right ) \cos (c+d x) (\sin (c+d x)+1)^{-n-\frac {1}{2}} (a \sin (c+d x)+a)^n \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right )}{d (n+1) (n+2)}+\frac {\cos (c+d x) (a \sin (c+d x)+a)^n}{d \left (n^2+3 n+2\right )}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2759, 2751, 2652, 2651} \[ -\frac {2^{n+\frac {1}{2}} \left (n^2+n+1\right ) \cos (c+d x) (\sin (c+d x)+1)^{-n-\frac {1}{2}} (a \sin (c+d x)+a)^n \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right )}{d (n+1) (n+2)}+\frac {\cos (c+d x) (a \sin (c+d x)+a)^n}{d \left (n^2+3 n+2\right )}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2651
Rule 2652
Rule 2751
Rule 2759
Rubi steps
\begin {align*} \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx &=-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\int (a (1+n)-a \sin (c+d x)) (a+a \sin (c+d x))^n \, dx}{a (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\left (1+n+n^2\right ) \int (a+a \sin (c+d x))^n \, dx}{(1+n) (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}+\frac {\left (\left (1+n+n^2\right ) (1+\sin (c+d x))^{-n} (a+a \sin (c+d x))^n\right ) \int (1+\sin (c+d x))^n \, dx}{(1+n) (2+n)}\\ &=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {2^{\frac {1}{2}+n} \left (1+n+n^2\right ) \cos (c+d x) \, _2F_1\left (\frac {1}{2},\frac {1}{2}-n;\frac {3}{2};\frac {1}{2} (1-\sin (c+d x))\right ) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d (1+n) (2+n)}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 54.58, size = 28439, normalized size = 182.30 \[ \text {Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.47, size = 0, normalized size = 0.00 \[ {\rm integral}\left (-{\left (\cos \left (d x + c\right )^{2} - 1\right )} {\left (a \sin \left (d x + c\right ) + a\right )}^{n}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \sin \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.82, size = 0, normalized size = 0.00 \[ \int \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +a \sin \left (d x +c \right )\right )^{n}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \sin \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\sin \left (c+d\,x\right )}^2\,{\left (a+a\,\sin \left (c+d\,x\right )\right )}^n \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \left (\sin {\left (c + d x \right )} + 1\right )\right )^{n} \sin ^{2}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________